GCC = g++
CPPFLAGS = -g -finline-functions -Wall -Winline -pipe -DOS_LINUX -fPIC
HEAD_INFO = -DPROJECT_NAME="\"FASTSEARCH\"" -DDESCRIPTION="\"FastSearch communication_manager\""

PB_PATH=../../../common/protobuf
COMMON_PATH=../../../common
	  
INCLUDES = -I./ \
		   -I$(COMMON_PATH)/commonlib/output/include \
		   -I$(PB_PATH)/include \

LIBS     = -L./ \
		   -L$(COMMON_PATH)/commonlib/output/lib -lcommonlib \
	       $(PB_PATH)/lib/libprotobuf.a \
		   -lm -lpthread -lcrypto -ldl

all : libcommunication_manager.a
	  mkdir -p output/include
	  mkdir -p output/lib
	  cp *.h output/include
	  cp *.a output/lib

libcommunication_manager.a:	communication_manager.o
	$(AR) -crv $@ $^

%.o : %.cpp
	$(GCC) $(CPPFLAGS) $(HEAD_INFO) -c $< -o $@ $(INCLUDES)

clean :
	rm -f *.o
	rm -rf *.a
	rm -rf output

